package models;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import play.data.validation.Required;
import play.db.jpa.Model;

/**
 * Class for table Cover.
 * 
 * @author Elisa
 */
@Entity
public class Cover extends Model {

	
	@ManyToOne
	public Book book;
	@ManyToOne
	public Cartoon cartoon;
	
	@Required
	public Integer ordernum;
	
	@Required
	public String path;

	/**
	 * Constructor for a book's cover.
	 * @param book
	 * @param ordernum
	 * @param path
	 */
	public Cover(final Book book, final Integer ordernum, final String path) {
		super();
		this.book = book;
		this.ordernum = ordernum;
		this.path = path;
	}
	
	/**
	 * Constructor for a book's cover.
	 * @param book
	 * @param ordernum
	 * @param path
	 */
	public Cover(final Cartoon cartoon, final Integer ordernum, final String path) {
		super();
		this.cartoon = cartoon;
		this.ordernum = ordernum;
		this.path = path;
	}


	
}
